import { query } from 'express';
import { MigrationInterface, QueryRunner } from 'typeorm';

export class Data1729233294219 implements MigrationInterface {
  public async up(queryRunner: QueryRunner): Promise<void> {
    await queryRunner.query(
      "INSERT INTO `users` VALUES (1,'admin','e10adc3949ba59abbe56e057f20f883e','管理员123','15708489575@163.com','http://localhost:3005/uploads\\1727428306733-506170626-wallhaven-6k35rl.jpg','13233323333',0,1,'2024-09-23 09:31:31.477365','2024-09-27 17:28:22.000000'),(2,'zhangsan','e10adc3949ba59abbe56e057f20f883e','张三','15708489575@163.com','http://localhost:3005/uploads\\1727332799071-566107626-3.png',NULL,1,0,'2024-09-23 09:31:31.489830','2024-09-26 14:40:09.000000');",
    );
    await queryRunner.query(
      "INSERT INTO `roles` VALUES (1,'管理员'),(2,'普通用户');",
    );
    await queryRunner.query(
      "INSERT INTO `permissions` VALUES (1,'ccc','访问 ccc 接口'),(2,'ddd','访问 ddd 接口');",
    );
    await queryRunner.query(
      'INSERT INTO `role_permissions` VALUES (1,1),(1,2),(2,1);',
    );
    await queryRunner.query('INSERT INTO `user_roles` VALUES (1,2),(2,1);');
    await queryRunner.query(
      "INSERT INTO `meeting_room` VALUES (1,'开发会议室',100,'东一层','电视、白板','123',0,'2024-10-09 17:08:14.710537','2024-10-09 17:08:14.710537'),(2,'会议室1',10,'东二层','电视','',0,'2024-10-10 14:16:33.921378','2024-10-10 14:16:33.921378'),(3,'会议室2',20,'东三层','白板','',0,'2024-10-10 14:16:52.155924','2024-10-10 14:16:52.155924');",
    );
    await queryRunner.query(
      "INSERT INTO `booking` VALUES (1,'2024-10-07 00:00:00','2024-10-09 00:00:00','4','sgsdg','2024-10-10 14:09:10.017167','2024-10-10 14:52:07.000000',1,1),(2,'2024-10-07 00:00:00','2024-10-09 00:00:00','3','ghg','2024-10-10 14:17:25.788240','2024-10-10 14:52:13.000000',1,2),(3,'2024-10-07 00:00:00','2024-10-09 00:00:00','3','sgd','2024-10-10 14:17:34.413235','2024-10-10 14:18:39.530319',1,3);",
    );
  }

  public async down(queryRunner: QueryRunner): Promise<void> {
    await queryRunner.query('TRUNCATE TABLE booking');
  }
}
